import request from '@/config/axios'

// 配送订单操作日志 VO
export interface DeliveryOrderLogVO {
  id: number // 主键ID
  orderId: number // 配送订单ID
  operationType: string // 操作类型（创建、发货、送达、取消等）
  operationContent: string // 操作内容
  operatorId: number // 操作人ID
  operatorName: string // 操作人姓名
  operationTime: Date // 操作时间
  remark: string // 备注
}

// 配送订单操作日志 API
export const DeliveryOrderLogApi = {
  // 查询配送订单操作日志分页
  getDeliveryOrderLogPage: async (params: any) => {
    return await request.get({ url: `/trade/delivery-order-log/page`, params })
  },

  // 查询配送订单操作日志详情
  getDeliveryOrderLog: async (id: number) => {
    return await request.get({ url: `/trade/delivery-order-log/get?id=` + id })
  },

  // 新增配送订单操作日志
  createDeliveryOrderLog: async (data: DeliveryOrderLogVO) => {
    return await request.post({ url: `/trade/delivery-order-log/create`, data })
  },

  // 修改配送订单操作日志
  updateDeliveryOrderLog: async (data: DeliveryOrderLogVO) => {
    return await request.put({ url: `/trade/delivery-order-log/update`, data })
  },

  // 删除配送订单操作日志
  deleteDeliveryOrderLog: async (id: number) => {
    return await request.delete({ url: `/trade/delivery-order-log/delete?id=` + id })
  },

  // 导出配送订单操作日志 Excel
  exportDeliveryOrderLog: async (params) => {
    return await request.download({ url: `/trade/delivery-order-log/export-excel`, params })
  }
}
